using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Joy.Erp.BasicArchives.Core.Filters;

namespace Joy.Erp.BasicArchives.Procurements
{
    [RemoteService(Name = BasicArchivesRemoteServiceConsts.RemoteServiceName)]
    [Area(BasicArchivesRemoteServiceConsts.ModuleName)]
    [ControllerName("PurchaseOrderType")]
    [Route("api/basic-archives/purchase-order-type")]
    public partial class PurchaseOrderTypeController : BasicArchivesController, IPurchaseOrderTypeAppService
    {
        protected IPurchaseOrderTypeAppService PurchaseOrderTypeAppService => LazyServiceProvider.LazyGetRequiredService<IPurchaseOrderTypeAppService>();

        [HttpGet]
        [Route("{id}")]
        public Task<PurchaseOrderTypeDto> GetAsync(Guid id)
        {
            return PurchaseOrderTypeAppService.GetAsync(id);
        }

        [HttpGet]
        [Route("find")]
        public Task<PurchaseOrderTypeDto> FindAsync(string filter)
        {
            return PurchaseOrderTypeAppService.FindAsync(filter);
        }

        [HttpGet]
        [Route("find-by-source-key")]
        public Task<PurchaseOrderTypeDto> FindBySourceKeyAsync(string sourceKey, string sourceType)
        {
            return PurchaseOrderTypeAppService.FindBySourceKeyAsync(sourceKey, sourceType);
        }

        [HttpGet]
        public Task<PagedResultDto<PurchaseOrderTypeDto>> GetListAsync(FilterRequestDto input)
        {
            return PurchaseOrderTypeAppService.GetListAsync(input);
        }

        [HttpPost]
        [Route("query")]
        public Task<PagedResultDto<PurchaseOrderTypeDto>> QueryAsync(FilterGroupRequestDto input)
        {
            return PurchaseOrderTypeAppService.QueryAsync(input);
        }

        [HttpPost]
        public Task<PurchaseOrderTypeDto> CreateAsync(PurchaseOrderTypeCreateDto input)
        {
            return PurchaseOrderTypeAppService.CreateAsync(input);
        }

        [HttpPut]
        [Route("{id}")]
        public Task<PurchaseOrderTypeDto> UpdateAsync(Guid id, PurchaseOrderTypeUpdateDto input)
        {
            return PurchaseOrderTypeAppService.UpdateAsync(id, input);
        }

        [HttpDelete]
        [Route("{id}")]
        public Task DeleteAsync(Guid id)
        {
            return PurchaseOrderTypeAppService.DeleteAsync(id);
        }
    }
} 